<%@page import="Entities.*"%>
<%@page import="Helpers.*"%>
<%@page import="Hibernate.*"%>
<%@page import="java.util.List"%>
<%@page import="java.util.HashSet" %>
<%@page import="java.util.Set" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@include file="../../views/header.jsp" %>
<%@include file="../../views/mainMenu.jsp" %>
<%@include file="../../views/userMenu.jsp" %>
<%@include file="../../views/cntColumnOpen.jsp" %>

<%
//enquete is van te voren geselecteerd
        String eid = (String) request.getParameter("eid");

        EnqueteHelper ehelper = new EnqueteHelper();
        Enquetes enquete = ehelper.getEnquete(Integer.parseInt(eid));
%>
<h2>Enquete: <%=enquete.getNaam()%> </h2>
<li class="likert">
    <%
        EnquetteVragenHelper evhelper = new EnquetteVragenHelper();
        AntwoordEnquetevragenHelper aevhelper = new AntwoordEnquetevragenHelper();
        List<EnquetteVragen> evragenlist = evhelper.getenquetteVragen(Integer.parseInt(eid));
        for (EnquetteVragen vraag : evragenlist) {
            Set aevragen = vraag.getAntwoordEnquetevragens();
    %>
    <table cellspacing="0">
        <thead>
            <tr>
                <th><b><%=vraag.getVraag()%></b></th>
            </tr>
        </thead>
        <tbody><%
        Iterator iterator;
        if (aevragen.isEmpty()) {
            %><tr><th>Nog geen feedback gegeven. </th></tr><%
            } else {
                iterator = aevragen.iterator();
                while (iterator.hasNext()) {
            %><tr><th><%AntwoordEnquetevragen aev = (AntwoordEnquetevragen) iterator.next();%>
            <%=aev.getAntwoord()%></th></tr>
            <%}
        }
            %>
        </tbody>
    </table>
    <%}
    %>

</li>

<div class="fix"></div>
<!--/post-->

<br class="fix" />

<%@include file="../../views/cntColumnRight.jsp" %>
<%@include file="../../views/footer.jsp" %>
